<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="/WEB-INF/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"	href="../../../styles/objectsStyles.css">
<script type="text/javascript">
function accion(option){
	document.forms[0].method.value=option;		
	document.forms[0].submit(); 
} 
function change(){
	document.forms[0].method.value='init';
	document.forms[0].submit(); 
} 
function changeStyle(tableID,rowNumber,styleCellSelected,styleCellEven,styleCellOdd,type){
	var theTable = document.getElementById(tableID);
	var theRow = theTable.rows[rowNumber];
	//type==1 MultipleSelection
	if(type==1){
		for(r = 0; r < theRow.cells.length; r++){
			if(theRow.cells[r].className==styleCellSelected){
				if(mod(rowNumber,2)==0)theRow.cells[r].className=styleCellEven;
				else theRow.cells[r].className=styleCellOdd;
			}
			else theRow.cells[r].className=styleCellSelected;
		}
	}else{
		for(j = 0; j < theRow.cells.length; j++) theRow.cells[j].className=styleCellSelected;
		for (i = 1; i < theTable.rows.length; i++) {
			if(i != rowNumber ) {
				rowEl = theTable.rows[i];
				for(c = 0; c < rowEl.cells.length; c++) {
					if(mod(i,2)==0)
						rowEl.cells[c].className=styleCellEven;
					else
						rowEl.cells[c].className=styleCellOdd;
					}
				}
			}
		} 
	}
	function mod(a,b){
		return a - Math.floor(a / b) * b;
	}
</script>
</head>
<body class="application-window-body">
<html:form action="cedula.do"  method="post">
	<input type="hidden" name="method" />
	<input type="hidden" name="view" />
	<table class="matrix-pane" cellpadding="0" cellspacing="1" width="100%">
		<tr>
			<td class="matrix-pane-cell">
			<table class="matrix-pane" cellpadding="0" cellspacing="0"
				width="100%">

				<tr height="1px">
					<td class="matrix-pane-cell">
					<table class="application-bar" cellpadding="0" cellspacing="0px"
						width="100%">
						<tr>
							<td class="application-bar-cell" width="1px">
							<table class="matrix-pane" cellpadding="0" cellspacing="1"
								width="100%" height="100%">
								<tr>
									<td class="matrix-pane-cell">
									<div class="label" nowrap><bean:message 
										key="label.cedula.anio" /></div>

									</td>
									<td class="matrix-pane-cell">
										<html:select   property="anioCedula" styleClass="object-combo" onchange="javascript:change()">
											<html:options collection="listAniosCedula"
														  property="anio" labelProperty="anio"/>
										</html:select>
									</td>
									<td class="matrix-pane-cell">
									<table cellspacing="0" cellpadding="0">
											<tr>
					  				  <td>
									 </td> </tr></table>
									</td>
								</tr>

							</table>
							</td>
							<td class="application-bar-cell">&nbsp;</td>
							<td class="application-bar-cell"></td>
						</tr>
					</table>
					</td>
				</tr>
				<tr>

					<td class="matrix-pane-cell">
					<table class="with-margin" cellpadding="0" cellspacing="1"
						width="100%">
						<tr>
							<td class="with-margin-cell">
							<table class="app-caption" cellpadding="0" cellspacing="1"
								width="100%">
								<tr>
									<td class="app-caption-cell">
									<div class="app-caption-content" nowrap><bean:message
										 key="label.cedula.title" /></div>

									</td>
								</tr>
							</table>
							</td>
						</tr>
						<tr>  
							<td class="matrix-pane-cell">  
								<display:table	name="${listCedula}" id="beanCedula" requestURI="cedula.do" pagesize="15"
								    class="table" style="height:16px;width:100%"  cellspacing="0"  cellpadding="0">
								  <display:column title=""  style="width:16;align:center"   headerClass="table-head" >
									  <html:radio   property="rowIdCedula" value="beanCedula_rowNum" styleClass="table-radio-button"
									  				onclick="javaScript:changeStyle('beanCedula',mod(this.value,15),'table-cell-selected','table-cell-even','table-cell-odd',0)"/>
								  </display:column>
								  <display:column property="nombre"   headerClass="table-head" 
								                  style="width:100px;align:left"  title="Name"/>
								  <display:column property="javaclassname"  headerClass="table-head"  style="width:100px;align:left"
								  				  title="Details"  /> 
								</display:table>
							</td>
						</tr>

						<tr>
							<td class="with-margin-cell">
							<table class="options-bar-bottom" cellpadding="0" cellspacing="1"
								width="100%">
								<tr>
									<td class="options-bar-bottom-cell">
									<table class="options-bar-pane" cellpadding="0" cellspacing="1"
										width="100%" height="100%">
										<tr>
											<td class="options-bar-pane-cell" width="1px">
												<input type="button" class="button"
													   onclick="javascript:accion('add')"
													   value="<bean:message  key="button.label.add"/>" />
											</td>
											<td class="options-bar-pane-cell" width="1px">
												<input type="button" class="button"
													   onclick="javaScript:enableDisabledButton(this,true);javascript:accion('edit')"
													   value="<bean:message  key="button.label.edit"/>" />											
											</td>
											<td class="options-bar-pane-cell" width="1px">
											<input type="button" class="button"
													   onclick="javaScript:enableDisabledButton(this,true);javascript:accion('delete')"
													   value="<bean:message  key="button.label.delete"/>" />											
											</td>
											<td class="options-bar-pane-cell"></td>
											<td class="options-bar-pane-cell"></td>

											<td class="options-bar-pane-cell"></td>
											<td class="options-bar-pane-cell"></td>
											<td class="options-bar-pane-cell"></td>
											<td class="options-bar-pane-cell"></td>
											<td class="options-bar-pane-cell">&nbsp;</td>
											<td class="options-bar-pane-cell"></td>
										</tr>
									</table>
									</td>

								</tr>
							</table>
							</td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			</td>

		</tr>
	</table>

</html:form>
</body>
</html>